package com.songlanyun.modules.returnaddress.controller.api;

import com.songlanyun.common.utils.R;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.returnaddress.entity.ReturnAddress;
import com.songlanyun.modules.returnaddress.service.ReturnAddressService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 商家收货地址
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-11 13:39:14
 */
@RestController
@RequestMapping("api/returnaddress")
public class ReturnAddressApiController extends AbstractApiController {

    @Autowired
    private ReturnAddressService returnAddressService;



    /**
     * 获取自家店铺的收货地址
     */
    @RequestMapping("/info/{shopId}")
    //@RequiresPermissions("returnaddress:shopreturnaddress:info")
    public R info(@PathVariable("shopId") Long shopId){
        ReturnAddress shopReturnAddress = returnAddressService.getReturnAddress(shopId);
        return R.ok().put("data", shopReturnAddress);
    }
}
